package com.mi.system.dto.request;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 *  Dept request DTO
 *
 *  @author     jin_huaquan
 *  @date      2021/11/2 13:59
 *  @version   1.0
 */
@ApiModel(value = "DeptRequestDTO对象", description = "部门请求信息")
@Data
public class DeptRequestDTO {

    @ApiModelProperty(value = "上级部门ID", required = true, dataType = "java.lang.String")
    @NotNull(message = "上级部门的ID不能为空")
    private Long parentId;

    @ApiModelProperty(value = "部门名称", required = true)
    @NotBlank(message = "部门的名称不能为空")
    @Length(min = 1, max = 64, message = "部门的名称字符长度不能大于64个")
    private String name;

    @ApiModelProperty(value = "排序值", required = true)
    @NotNull(message = "排序值不能为空")
    @Range(min = 0, max = 9999, message = "排序值必须在0至9999范围内")
    private Integer sort;
}
